package com.gton.lpl.common.service;

import com.aliyun.oss.OSS;
import org.springframework.web.multipart.MultipartFile;

/**
 * @description: OSS操作
 * @author: GuoTong
 * @createTime: 2022-08-16 21:54
 * @since JDK 1.8 OR 11
 **/
public interface OSSCommonServer {
    String DefaultUserKey = "Admin";

    /**
     * Description:  判断文件是否存在
     *
     * @param keyName
     * @param isINoss 是否强制
     * @author: GuoTong
     * @date: 2022-08-16 22:07:55
     * @return:boolean
     */
    public boolean fileIsExist(String keyName, boolean isINoss);

    /**
     * Description: 文件上传OSS
     *
     * @param multipartFile 上传文件
     * @param userKey       用户唯一上传的Key
     * @author: GuoTong
     * @date: 2022-08-20 15:54:19
     * @return:java.lang.String 文件的保存的URL
     */
    public String singleFileUploadOSS(MultipartFile multipartFile, String userKey);

    /**
     * Description:  获取OSSClient对象
     *
     * @author: GuoTong
     * @date: 2022-08-20 14:53:14
     */

    public OSS getOSSClient();
}
